import os

db_uri = 'mysql+pymysql://oldpan:whnb@localhost:3306/qd_ie'


class Config:
    DEBUG = True
    SERVER_NAME = 'www.whnb.com:5000'
    SECRET_KEY = 'Nikolai_Ostrovsky'
    # databases
    SQLALCHEMY_DATABASE_URI = db_uri
    SQLALCHEMY_TRACE_MODIFICATIONS = False
    # path
    BASE_DIR = os.path.dirname(os.path.abspath(__file__))
    STATIC_DIR = os.path.join(BASE_DIR, 'static')
    TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
    UPLOAD_DIR = os.path.join(STATIC_DIR, 'uploads')
    # 头像上传目录
    ICON_DIR = os.path.join(UPLOAD_DIR, 'icon')
    # 相册上传目录
    PHOTO_DIR = os.path.join(UPLOAD_DIR, 'photo')


class Development(Config):
    ENV = 'development'


class Production(Config):
    DEBUG = False
    ENV = 'production'


if __name__ == '__main__':
    print(Config.BASE_DIR)
